
#ifndef IMAGE_LOADER_H
#define IMAGE_LOADER_H

// INCLUDES ********************************************************************

#include <string>

// FORWARD DECLARATIONS ********************************************************

/*******************************************************************************
 
 TODO:  - functions to load/store files
        - use library/caches instead of documents?
 
*******************************************************************************/

// *****************************************************************************

//! FileUtils
//! 
//! Class handling filesystem access, writing or reading files to/from
//! directories. Will abstract the underlying system functions for Meteor.

// *****************************************************************************

namespace Meteor 
{
    class FileUtils
    {
        public:
            //! return the applications bundle path, contents can then
            //! be accessed relative from thereon
            static const std::string ResourcePath();
        
            //! returns a full path for a file in the app bundle
            static const std::string ResourcePathForFile( const std::string& fileName);
            
            //! returns a path to the user directory, where arbitrary data can
            //! be written to. note that this is the same location as being used
            //! in the writeFile and loadFile methods
            static const std::string WritableDirectorY();
        
            //! returns a full path for a file in the app bundle
            static const std::string WritablePathForFile( const std::string& fileName);
            
            //! check if 'filename' exists in the app bundle
            static bool ResourceExists( std::string filename);
        
            static const size_t SizeOfFile( const std::string& fileName);
        
        
            static const bool WriteFile( const std::string& data,
                                         const std::string& fileName,
                                         const std::string& subDirectory = "");
                                   
            static const bool ReadFile( const std::string& fileName,
                                        char* buffer,
                                        const size_t numBytes,
                                        const size_t offset = 0,
                                        const std::string& subDirectory = "");
        
        
            static const bool ReadFile( const std::string& fileName,
                                        char* buffer,
                                        const std::string& subDirectory = "");
                                  
            
    }; // end of class FileUtils

} // end of namespace Meteor

#endif

